package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.SysFaqMapper;
import com.hgkj.cloud.base.domain.SysFaq;
import com.hgkj.cloud.base.service.SysFaqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysFaqServiceImpl implements SysFaqService {

    @Autowired
    private SysFaqMapper sysFaqMapper;

    @Override
    public int deleteByPrimaryKey(String uuid) {
        return sysFaqMapper.deleteByPrimaryKey(uuid);
    }

    @Override
    public int insert(SysFaq record) {
        return sysFaqMapper.insert(record);
    }

    @Override
    public int insertSelective(SysFaq record) {
        return sysFaqMapper.insertSelective(record);
    }

    @Override
    public SysFaq selectByPrimaryKey(String uuid) {
        return sysFaqMapper.selectByPrimaryKey(uuid);
    }

    @Override
    public int updateByPrimaryKeySelective(SysFaq record) {
        return sysFaqMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(SysFaq record) {
        return sysFaqMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<SysFaq> listAllFaqs() {
        return sysFaqMapper.listAllFaqs();
    }

    @Override
    public List<SysFaq> getlistFaqsType() {
        return sysFaqMapper.getlistFaqsType();
    }

    @Override
    public List<SysFaq> listAllFaqsPage(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return sysFaqMapper.listAllFaqsPage(map);
    }

    @Override
    public long listAllFaqsPageCount(Map<String, Object> map) {
        return sysFaqMapper.listAllFaqsPageCount(map);
    }

    @Override
    public SysFaq getFaqByUuid(String uuid) {
        return sysFaqMapper.getFaqByUuid(uuid);
    }
}
